'use strict'

const fs = require('fs')
const path = require('path')

const basename = path.basename(module.filename)
const dirname = __dirname

const mdw = {}

fs.readdirSync(dirname)
  .filter(file => {
    return (file.indexOf('.') !== 0) && (file !== basename)
  })
  .forEach(file => {
    mdw[file.replace(/^(.*)\.js$/, '$1')] = require(path.join(dirname, file))
  })

module.exports = mdw
